<?
error_reporting(E_ALL); ini_set('display_errors', '1');   $ACMEPATH = dirname(__FILE__);   ini_set( 'date.timezone', 'America/New_York' ); 
set_error_handler("cErr");

function ech($a) { 
		echo "<pre>";
		print_r($a);
		echo "</pre>";
}
function cErr($no, $str, $file, $line, $context) {
		$s=date("Y-m-d H:i:s")."  $str - Line #$line ".error_get_last()."\r\n";	file_put_contents("log.txt", $s, FILE_APPEND);
}
function __t($fn, $data=array()) {  
		$lfn = "plugins/{$fn}.php";
		if(!file_exists($lfn)) file_put_contents($lfn, file_get_contents("http://acme-web.googlecode.com/svn/plugins/$fn.php"));
		include "plugins/{$fn}.php";	
}

function get($u) {	
	$ch = curl_init($u); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);	$res = curl_exec($ch);	curl_close($ch);	return $res;	}
function sql($q) { 	
   $h = mysql_connect('localhost', 'cdrnet', 'yeahbuddy'); mysql_select_db('cdrnet_test');$res=mysql_query($q, $h); $ret=array();
	if(gettype($res)=='boolean')  ;	while($r = mysql_fetch_assoc($res)) $ret[]=$r;	return $ret;	}
function sql2($q) {  global $dbname; $d=new PDO("sqlite:".$dbname);  $s=$d->prepare($q);   $s->execute();  $res = $s->   fetchAll(PDO::FETCH_ASSOC);   return $res;	}

extract($_REQUEST, EXTR_SKIP); 
?>